import java.util.Arrays;

public class Employee {
    public int wage;
    public int prize;
    public Employee(int wage,int prize){
        this.wage=wage;
        this.prize=prize;
    }
    public void getSum(){
        int sum=this.wage+this.prize;
        System.out.println("薪资为："+sum);
    }
    public static void mysort(Employee[] arrays){
        for (int i = 0; i < arrays.length-1; i++) {
            for (int j = 0; j < arrays.length-1-i; j++) {
                if(arrays[i].wage>arrays[i+1].wage){
                    Employee t=arrays[i];
                    arrays[i]=arrays[i+1];
                    arrays[i+1]=t;
                }
            }
        }
    }

    public static void main(String[] args) {
        Employee employee1=new Employee(20000,10000);
        Employee employee2=new Employee(30000,20000);
        Employee employee3=new Employee(40000,30000);
        Employee[] array={employee1,employee2,employee3};
        mysort(array);
    }
}
